package com.vibrationkeyboard.app.utils

object Constants {
    
    // 传感器相关常量
    const val SAMPLE_RATE_DEFAULT = 100 // Hz
    const val SAMPLE_RATE_MIN = 50 // Hz
    const val SAMPLE_RATE_MAX = 150 // Hz
    
    // 信号处理常量
    const val ENERGY_THRESHOLD_HIGH = 0.8f
    const val ENERGY_THRESHOLD_LOW = 0.3f
    const val ZERO_CROSSING_THRESHOLD = 0.5f
    const val MIN_SILENCE_LENGTH = 0.1f // 秒
    const val MIN_SPEECH_LENGTH = 0.05f // 秒
    
    // 特征提取常量
    const val FRAME_LENGTH = 256
    const val FRAME_SHIFT = 128
    const val FFT_SIZE = 512
    
    // 键位识别常量
    const val KNN_NEIGHBORS = 5
    const val CONFIDENCE_THRESHOLD = 0.7f
    const val MAX_CANDIDATES = 3
    
    // 文件相关常量
    const val DATA_DIR = "vibration_keyboard_data"
    const val EXPORT_FILE_PREFIX = "export_"
    const val SENSOR_DATA_FILE_PREFIX = "sensor_data_"
    
    // 通知相关常量
    const val NOTIFICATION_ID = 1001
    const val CHANNEL_ID = "sensor_service_channel"
    const val CHANNEL_NAME = "传感器数据采集"
    
    // Wear OS 数据层常量
    const val SENSOR_DATA_PATH = "/sensor_data"
    const val RECOGNITION_RESULT_PATH = "/recognition_result"
    const val COMMAND_PATH = "/command"
    const val STATUS_PATH = "/status"
    
    // 广播动作常量
    const val ACTION_SENSOR_DATA_ACCELEROMETER = "SENSOR_DATA_ACCELEROMETER"
    const val ACTION_SENSOR_DATA_GYROSCOPE = "SENSOR_DATA_GYROSCOPE"
    const val ACTION_RECOGNITION_RESULT = "RECOGNITION_RESULT"
    
    // 服务动作常量
    const val ACTION_SYNC_SENSOR_DATA = "SYNC_SENSOR_DATA"
    const val ACTION_EXPORT_DATA = "EXPORT_DATA"
    const val ACTION_CLEAR_DATA = "CLEAR_DATA"
    
    // 设置相关常量
    const val PREFS_NAME = "vibration_keyboard_settings"
    const val KEY_SAMPLE_RATE = "sample_rate"
    const val KEY_SENSOR_DELAY = "sensor_delay"
    const val KEY_VIBRATION_FEEDBACK = "vibration_feedback"
    const val KEY_AUTO_CORRECT = "auto_correct"
    const val KEY_SOUND_FEEDBACK = "sound_feedback"
    
    // 错误消息常量
    const val ERROR_SENSOR_NOT_AVAILABLE = "传感器不可用"
    const val ERROR_PERMISSION_DENIED = "权限被拒绝"
    const val ERROR_DATA_PROCESSING = "数据处理错误"
    const val ERROR_NETWORK_UNAVAILABLE = "网络不可用"
    
    // 成功消息常量
    const val SUCCESS_SENSOR_STARTED = "传感器已启动"
    const val SUCCESS_SENSOR_STOPPED = "传感器已停止"
    const val SUCCESS_DATA_SAVED = "数据已保存"
    const val SUCCESS_RECOGNITION = "识别成功"
} 